package main.action;

import java.sql.SQLException;
import java.util.List;

import admin.board.category.dao.CategoryDao;
import admin.board.category.dto.CategoryDto;
import board.freeboard.dao.BoardDao;
import board.freeboard.dto.BoardDto;

import com.opensymphony.xwork2.ActionSupport;

public class ListAction extends ActionSupport {
	private CategoryDao categoryDao;
	private BoardDao boardDao;
	
	private final int NOTICE = 1;
	private final int HELLOBOARD = 11;
	private final int FREEBOARD = 13;
	
	private List<CategoryDto> categoryList;
	private List<BoardDto> freeboardIssueList;
	
	public ListAction() {
		categoryDao = CategoryDao.getInstance();
		boardDao = BoardDao.getInstance();
	}
	
	public String execute() throws SQLException {
		categoryList = categoryDao.list();
		freeboardIssueList = boardDao.issueList(FREEBOARD);
		
		return SUCCESS;
	}

	public List<CategoryDto> getCategoryList() {
		return categoryList;
	}

	public void setCategoryList(List<CategoryDto> categoryList) {
		this.categoryList = categoryList;
	}

	public List<BoardDto> getFreeboardIssueList() {
		return freeboardIssueList;
	}

	public void setFreeboardIssueList(List<BoardDto> freeboardIssueList) {
		this.freeboardIssueList = freeboardIssueList;
	}
}
